package com.yunhe.abnormal.service.data;

import com.yunhe.abnormal.domain.data.AbnormalSmsConfig;
import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.ObjectNotFoundException;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.common.exception.UserNotFoundException;
import com.yunhe.common.model.PageParam;

import java.util.Optional;

public interface AbnormalSmsConfigService {

    AbnormalSmsConfig createConfig(AbnormalSmsConfig abnormalSmsConfig) throws UniqueConstraintsException, ArgumentErrorException, ObjectNotFoundException, UserNotFoundException;

    void delete(Long id);

    AbnormalSmsConfig updateConfig(AbnormalSmsConfig abnormalSmsConfig) throws UniqueConstraintsException, ArgumentErrorException, ObjectNotFoundException, UserNotFoundException;

    AbnormalSmsConfig updateConfig(Long id,
                                   Optional<Long> userId,
                                   Optional<String> internationalCode,
                                   Optional<String> phone,
                                   Optional<String> dtime,
                                   Optional<Boolean> remind)
            throws UniqueConstraintsException, ArgumentErrorException, ObjectNotFoundException, UserNotFoundException;

    AbnormalSmsConfig findById(Long id) throws ObjectNotFoundException;

    AbnormalSmsConfig findByUserId(Long id) throws ObjectNotFoundException;

    AbnormalSmsConfig findByUserIdNeedInformed(Long id) throws ObjectNotFoundException;

    Iterable<AbnormalSmsConfig> search(Long firmId,
                                       Optional<String> phone,
                                       Optional<String> queryStr,
                                       PageParam pageParam);

}
